package com.xiaolin.designmode.composite.security;

/**
 * @ClassName Leaf
 * @Description 树叶构件角色
 * @Detail detail
 * @Author MyPC
 * @Date 2020/11/4
 * @Version 1.0
 */
public class Leaf implements Component{
    private String name;
    public Leaf(String name){
        this.name=name;
    }
    @Override
    public void add(Component component) {

    }

    @Override
    public void remove(Component component) {

    }

    @Override
    public Component getChildren(int index) {
        return null;
    }


    @Override
    public void operation() {
        System.out.println("我是"+name+"叶子构件");
    }
}
